package zq.cn.ioapp;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by ZQ on 2016/3/20.
 * 创建SQLiteOpenHelper
 */
public class MyOpenHelper extends SQLiteOpenHelper {

    public MyOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        String ddl = "create table users(_id integer primary key autoincrement,uname text,age integer);";
        db.execSQL(ddl);
    }

    @Override//升级操作
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        Log.i("zq",oldVersion+"........"+newVersion);
    }
}
